package resolvers

import (
	"context"
	"happy-sudoku/internal/codec"
	"happy-sudoku/internal/model"
)

type queryRootResolver struct{ *RootResolver }

func (r *queryRootResolver) Errors(ctx context.Context) ([]*codec.PropheticError, error) {
	return codec.ErrorList, nil
}
func (r *queryRootResolver) Player(ctx context.Context, playerID int) (*model.Player, error) {
	return r.playerSrv.GetOne(ctx, playerID)
}
func (r *queryRootResolver) Room(ctx context.Context, id int) (*model.Room, error) {
	return r.roomSrv.GetOneRoom(ctx, id)
}
func (r *queryRootResolver) Rooms(ctx context.Context) ([]*model.Room, error) {
	return r.roomSrv.GetAllRooms(ctx)
}
